#!/bin/bash

# load definitions & settings
source /usr/sbin/layers/dna/config

# shows presentation if user just types 'floflis':
if [ "$1" = "" ]; then
   cat << "EOF"
 
0===0
 O=o
  O
 o=O
0===0
 O=o     -. .-.   .-. .-.   .-. .-.   .
  O        \   \ /   \   \ /   \   \ /
 o=O      / \   \   / \   \   / \   \
0===0    ~   `-~ `-`   `-~ `-`   `-~ `-
 O=o
  O
 o=O       _            _           
0===0     |_  |   _   _|_  |  o   _
 O=o      |   |  (_)   |   |  |  _>
  O
 o=O         __| |_ __   __ _ 
0===0       / _` | '_ \ / _` |
 O=o       | (_| | | | | (_| |
  O         \__,_|_| |_|\__,_|
 o=O
0===0
 O=o
  O
 o=O
0===0

EOF
   echo "Type 'floflis --help' (without quotes) to see a list of available commands."
fi

# displays help message with a list of commands:
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
   cat << "EOF"

-. .-.   .-. .-.   .-. .-.   .
  \   \ /   \   \ /   \   \ /
 / \   \   / \   \   / \   \
~   `-~ `-`   `-~ `-`   `-~ `-

EOF
   echo "Use these commands after/together with 'floflis' command."
   echo "Available commands:"
   echo "Information:"
   echo "   --help, -h                  Shows all available commands"
fi

# load modules
# -
# information-reader
if [ -e /usr/sbin/layers/dna/modules/information-reader ]
then
    source /usr/sbin/layers/dna/modules/information-reader
fi
# energyupdate
if [ -e /usr/sbin/layers/dna/modules/energy ]
then
    source /usr/sbin/layers/dna/modules/energy
fi
# update
if [ -e /usr/sbin/layers/dna/modules/update ]
then
    source /usr/sbin/layers/dna/modules/update
fi

# todo:support updates if Dat is installed

# todo:identify from settings parameters, and install (--all, etc)

# todo:upgrd

# todo:read-more lib
